package com.link.base.base.contacts.dao.mybatis.mapper;

import com.link.base.base.contacts.model.Contacts;
import com.link.core.basic.dao.mapper.BasicMapper;

import java.util.List;
/**
 * Copyright  hande Company. All Rights Reserved.
 *
 * @author  unknwon
 * @date:   2018/11/9 14:31
 * @version 1.0
 */

public interface ContactsMapper extends BasicMapper<Contacts> {
    /**
     * <p>查找非子联系人及本身</p>
     *
     * @param contacts
     * @return
     */
    public List<Contacts> queryContactsListRemoveIdAndChildrenPage(Contacts contacts);


    /**
     * 查找非联系人及本身的mysql过渡参数
     *
     * @param str
     * @return List
     * @throws Exception
     */
    public List<Contacts> queryContactsListRemoveIdAndChildrenPage(String str) throws Exception;


    /**
     * 根据当前联系人查根联系人
     * @param entity
     * @return
     * @throws Exception
     */
    public Contacts queryRoot(Contacts entity) throws Exception;

    /**
     * 根据当前联系人查所有子联系人
     * @param entity
     * @return
     * @throws Exception
     */
    public List<Contacts> queryChildTreeList(Contacts entity) throws Exception;

    /**
     * 得到所有子联系人的mysql方式
     *
     * @param str
     * @return List
     * @throws Exception
     */
    public List<Contacts> queryChildTreeList(String str) throws Exception;

    /**
     * 获取包含所有子联系人的id的字符串
     *
     * @param c
     * @return String
     * @throws Exception
     */
    public String getChildStr(Contacts c) throws Exception;

    /**
     * 更新联系人状态
     * @param entity
     * @throws Exception
     */
    public void statusUpdate(Contacts entity) throws Exception;

}
